package com.lixinyue.working;

import java.util.Scanner;

/*
递归方法的使用

 */
public class RecursionTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        RecursionTest t = new RecursionTest();
        System.out.println( t.getSum(n));
        System.out.println( t.getSub(n));

    }
    public int getSum(int n)
    {
        if(n==1)
        {
            return 1;
        }
        else{
            return n+getSum(n-1);
        }
    }
    public int getSub(int n)
    {
        if(n==1)
        {
            return 1;
        }else
        {
            return n*getSub(n-1);
        }
    }


}
